home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD ROM Paradise Collection 4
/
CD ROM Paradise Collection 4 1995 Nov.iso
/
program
/
swagd_f.zip
/
EGAVGA.SWG
/
0182_Get the Video Page.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1995-03-03
|
1KB
|
27 lines
{
From: josephw@ramp.com (Joe Wilcox)
>> Are there any Pascal function/procedures that will return to me the DOS
>> segment of the current video page? If not, is there an easy way
>> to do this? Thanks!
>Not built-in Pascal, as far as I know (perhaps in graphics mode, using the
>Graph unit, but I don't use it). In text mode, each screen takes 2*80*25 =
>4000 bytes, so I think you simply add a 4K (that is, 4096) offset for each
>logical page. Screen mode 3, co80, mem. starts at phys. address B8000h.
Ok, if you are trying to find the segment in text mode, it's real easy..
here is a function...
}
function GetVPage : word;
asm
mov BX,$B000; { Default is monochrome segment }
mov AH,$0F; { Bios function 0Fh : Get Video Mode }
int $10; { Do a Bios video interrupt }
cmp AL,$07; { Are we in monochrome? }
je @@Done; { Yes, then jump }
mov BX,$B800; { Set it to the color segment }
@@Done:
mov AX,BX; { Return the value in AX }
end;